/*
 * [Ronny Abraham]
 * [ronnya@gmail.com]
 * CS530:DUI, Assignment [#1]
 */

import java.util.Vector;
import javax.swing.table.AbstractTableModel;


public class ActorsTableModel  extends AbstractTableModel{

	@Override
	public int getRowCount() {
		return actorsVector.size();
	}

	@Override
	public int getColumnCount() {
		return 6;
	}

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		return actorsVector.get(rowIndex).getValueAt(columnIndex);
	}
	
	public String getColumnName(int column) {
	    return headers[column];
	  }
	
	public void addActor(Actor actor){
		actorsVector.add(actor);
	}
	
	public void removeActor(int index)
	{
		actorsVector.remove(index);
	}
	
	public Actor getActor(int index)
	{
		if(index < actorsVector.size())
		{
			return actorsVector.get(index);
		}
		else
		{
			return null;
		}
	}

	Vector<Actor> actorsVector = new Vector<Actor>();
	private final String headers[] = {"Name", "Expression", "Shirt Color", "Pants Color", "Width", "Height"};
}
